<template>
    <div>
        <el-button style="background:#39CE75;border-color:#39CE75;" size="small" type="danger" @click="click">整改</el-button>
        <el-dialog append-to-body :visible.sync="dialogVisible" fullscreen :before-close="handleClose">
            <XDFullScreenA @close="handleClose" :config="config" :data="data"></XDFullScreenA>
        </el-dialog>
    </div>
</template>
<script>
import XDFullScreen from "@/components/EleTableComp/XDFullScreen";
import { typeJson } from "@/components/EleTableComp/config";
export default {
    props: ['data'],
    data() {
        return {
            dialogVisible: false,
            config: [
                {
                    label: '隐患详情',
                    ruleForm: [
                        {
                            label: '隐患级别',
                            prop: 'level',
                            type: 'dropDown',
                            list: typeJson.level,
                            value: ''
                        },
                        {
                            label: '隐患部位',
                            prop: 'part',
                            value: ''
                        },
                        {
                            label: '隐患来源',
                            prop: 'source',
                            type: 'dropDown',
                            list: typeJson.source,
                            value: ''
                        },
                        {
                            label: '隐患类别',
                            prop: 'name',
                            type: 'dropDown',
                            value: ''
                        },
                        {
                            label: '隐患描述',
                            prop: 'content',
                            value: ''
                        },
                        {
                            label: '隐患发现人',
                            prop: 'discoverMan',
                            value: ''
                        },
                        {
                            label: '发现时间',
                            prop: 'discoverDate',
                            value: ''
                        },
                        {
                            label: '隐患照片',
                            type: 'download',
                            prop: 'riskPhoto',
                            value: ''
                        },
                        {
                            label: '核查人',
                            prop: 'verifyMan',
                            value: ''
                        }
                    ],
                    ruleFormData: {},
                    disabled: true,
                },
                {
                    label: '核查情况',
                    ruleForm: [
                        {
                            label: '整改要求',
                            prop: 'rectifyRequire',
                            required: true,
                            value: ''
                        },
                        {
                            label: '整改类型',
                            prop: 'rectifyType',
                            type: 'dropDown',
                            list: typeJson.rectifyType,
                            value: ''
                        },
                        {
                            label: '整改方式',
                            prop: 'rectifyWay',
                            type: 'dropDown',
                            list: typeJson.rectifyWay,
                            value: ''
                        },
                        {
                            label: '整改期限',
                            prop: 'rectifyExpires',
                            type: 'timePicker',
                            required: true,
                            value: ''
                        },
                        {
                            label: '整改负责人',
                            prop: 'rectifyMan',
                            value: ''
                        },
                        {
                            label: '联系电话',
                            prop: 'phone',
                            value: ''
                        },
                    ],
                    ruleFormData: {},
                    disabled: true,
                },
                {
                    label: '整改情况',
                    ruleForm: [
                        // {
                        //     label: '整改状态',
                        //     prop: 'rectifyStatus',
                        //     type: 'dropDown',
                        //     list: typeJson.rectifyStatus,
                        //     value: ''
                        // },
                        // {
                        //     label: '整改情况',
                        //     prop: 'rectifyCase',
                        //     value: '',
                        //     type:"textArea",
                        //     required: true
                        // },
                        // {
                        //     label: '整改完成时间',
                        //     prop: 'rectifyFinishDate',
                        //     type: 'timePicker',
                        //     value: '',
                        //     required: true,
                        // },
                        // {
                        //     label: '整改图片',
                        //     prop: 'afterPhoto',
                          //     type: 'upload',
                        //     value: ''
                        // },
                        {
                            label: '整改确认状态',
                            prop: 'rectifyConfirmStatus',
                            type: 'dropDown',
                            list: typeJson.rectifyConfirmStatus,  
                            required: false,
                            value: ''
                        },

                    ],
                    ruleFormData: {},
                    insert: {
                        url: '/app/riskExcludeNew/update',
                        method: 'POST',
                        data: "this.config.ruleForm",
                        mineId: true,
                        params: {
                            
                        }
                    },
                },
                {
                    label: '复查情况',
                    ruleForm: [
                        {
                            label: '复查结果',
                            prop: 'reviewStatus',
                            type: 'dropDown',
                            list: typeJson.reviewStatus,
                            value: ''
                        },
                        {
                            label: '复查人或单位',
                            prop: 'reviewMan',
                            value: ''
                        },
                        {
                            label: '复查意见',
                            prop: 'reviewOpinion',
                            value: ''
                        },
                        {
                            label: '复查时间',
                            prop: 'reviewDate',
                            type: 'timePicker',
                            value: ''
                        },
                    ],
                    ruleFormData: {},
                    disabled: true
                },
                {
                    label: '检查信息',
                    ruleForm: [
                        {
                            label: '检查类别',
                            prop: 'planType',
                            type: 'dropDown',
                            list: typeJson.riskRule,
                            value: ''
                        },
                        {
                            label: '检查名称',
                            prop: 'planName',
                            value: ''
                        },
                        // {
                        //     label: '检查人',
                        //     prop: 'checkMan',
                        //     value: ''
                        // },
                        {
                            label: '检查时间',
                            prop: 'checkDate',
                            value: ''
                        },
                    ],
                    ruleFormData: {},
                    disabled: true,
                }
            ],
        }
    },
    created() {
        // console.log(this.data)
    },
    methods: {
        handleClose() {
            this.dialogVisible = false
        },
        click() {
            this.dialogVisible = true
        }
    },
    components: {
        XDFullScreen
    }
}
</script>